package isjinhao.jlox.grammar.statement.represention;

import isjinhao.jlox.lexical.Token;
import isjinhao.jlox.grammar.expression.represention.Expression;
import isjinhao.jlox.grammar.statement.visitor.StatementVisitor;
import lombok.Getter;

/**
 * @Author ISJINHAO
 * @Date 2021/2/22 18:45
 */
@Getter
public class VarDefinition extends Statement {

    public VarDefinition(Token name, Expression initializer) {
        this.name = name;
        this.initializer = initializer;
    }

    @Override
    public <R> R accept(StatementVisitor<R> statementVisitor) {
        return statementVisitor.visitVarDefinitionStmt(this);
    }

    private final Token name;
    private final Expression initializer;

}